HiKey: make RTC out of reset mode
authorHaojian Zhuang <[email protected]>
Wed, 18 Oct 2017 11:56:02 +0000 (19:56 +0800)
committerHaojian Zhuang <[email protected]>
Wed, 18 Oct 2017 12:02:12 +0000 (20:02 +0800)
Make RTC out of reset mode since it may be used in UEFI.

Signed-off-by: Haojian Zhuang <[email protected]>
plat/hisilicon/hikey/hikey_bl1_setup.c

index f59a54512d7a9f47613190d81f84b47a9881e60d..df0ad8e03760a13e879ded5badb12e53fc778c65 100644 (file)
@@ -489,6 +489,15 @@ static void hikey_mmc_pll_init(void)
        reset_mmc1_clk();
 }
 
+static void hikey_rtc_init(void)
+{
+       uint32_t data;
+
+       data = mmio_read_32(AO_SC_PERIPH_CLKEN4);
+       data |= AO_SC_PERIPH_RSTDIS4_RESET_RTC0_N;
+       mmio_write_32(AO_SC_PERIPH_CLKEN4, data);
+}
+
 /*
  * Function which will perform any remaining platform-specific setup that can
  * occur after the MMU and data cache have been enabled.
@@ -505,6 +514,8 @@ void bl1_platform_setup(void)
        hikey_pmussi_init();
        hikey_hi6553_init();
 
+       hikey_rtc_init();
+
        hikey_mmc_pll_init();
 
        memset(&params, 0, sizeof(dw_mmc_params_t));